<?php /* @var $this Controller */ ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" xmlns:fb="http://ogp.me/ns/fb#">
    <head>
       <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <meta name="language" content="en" />
        <meta name="description" content="<?php echo Yii::app()->params['meta_description'] ?>" />
        <meta name="keywords" content="<?php echo Yii::app()->params['meta_keywords'] ?>" />
          <?php
                if (isset($_GET['event'])) {
                    $event = Translate::model()->with('event')->find('event_id=' . $_GET['event']);
                    $gallery = Gallery::model()->with('items')->findByPk($event->event->gallery_id);
        //Get cover image for facebook
        $cover_image_face = Item::model()->findByAttributes(array('gallery_id' => $gallery->id, 'cover_image' => 1));
        $fbimg=  Yii::app()->getBaseUrl(true). '/data/image/event/' . $cover_image_face['name'];
        $fbtime  = date("H:i / d-m-Y",strtotime($event->event['start_date'].$event->event['start_time']));
        $fblocate = $event['location'] . ' , ' . $event['address'];
         $fbcontent = $event['sub_title'] . '<center></center> ,
             ' . $fbtime .' <center></center>,
                 '.$fblocate;      
         
                ?>   
         <title><?php echo $event['main_title'];?></title>
         <meta property="og:type" content="website" />
         <meta property="og:site_name" content="Upbeat.vn"/>
<meta property="og:title"           content="<?php echo $event['main_title'];?>" /> 
<meta property="og:image"           content="<?php echo $fbimg;?>" /> 
             <meta property="og:description" content="<?php echo $fbcontent;?>">
                <?php } ?>
        
              
                                <?php $this->widget('CssWidget'); ?>
                                <?php $this->widget('ScriptWidget'); ?>
                                <title><?php echo Yii::app()->params['title'] ?> - <?php echo CHtml::encode($this->pageTitle); ?></title>
                                <script>
                                    (function(i, s, o, g, r, a, m) {
                                        i['GoogleAnalyticsObject'] = r;
                                        i[r] = i[r] || function() {
                                            (i[r].q = i[r].q || []).push(arguments)
                                        }, i[r].l = 1 * new Date();
                                        a = s.createElement(o),
                                                m = s.getElementsByTagName(o)[0];
                                        a.async = 1;
                                        a.src = g;
                                        m.parentNode.insertBefore(a, m)
                                    })(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga');

                                    ga('create', 'UA-47968375-1', 'upbeat.vn');
                                    ga('send', 'pageview');

                                </script>
                                </head>
                                <style>
                                    body {
                                        background: url("<?php echo Yii::app()->baseUrl . '/data/background/' . Yii::app()->params['background']; ?>") no-repeat center top;
                                    }
                                </style>
                                <body>
                                    <div id="dim-block"></div>
                                    <div class="wrapper">
                                        <div class="modal " id="myModaldetail" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
                                            <div class="modal-dialog">
                                                <div class="modal-content">
                                                    <a class="fancybox-item ssclose"></a>
                                                    <div class="loading">
                                                        <div style="width:134px;height:100px;margin:0 auto;padding-top: 60px;">
                                                            <img src="<?php echo Yii::app()->theme->baseUrl; ?>/frontend/images/ajaxloader.gif">
                                                        </div>
                                                    </div>
                                                    <div class="modal-body event-details">



                                                    </div>
                                                </div><!-- /.modal-content -->
                                            </div><!-- /.modal-dialog -->
                                        </div>

<?php
if (Yii::app()->session['order_process']) {
    ?>
                                            }
                                            <div style="top:30%;height: 155px;padding: 0;" class="modal" id="ModalAlert" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
                                                <div class="modal-dialog">
                                                    <div class="modal-content">
                                                        <div class="modal-header">
                                                            <button aria-hidden="true" data-dismiss="modal" class="close" type="button"><img src="<?php echo Yii::app()->theme->baseUrl; ?>/frontend/images/icon_close.png" /></button>
                                                        </div>
                                                        <div class="modal-body ">
                                                        
    <?php
    $order = Booked::model()->find('ticket_order_number="' . Yii::app()->session['order_process'].'"'); 
    if (!$order->payment_status) {
        ?>
                                                                <p class="error">
<?php  echo Yii::t('lang', 'payment_cancel');?>                                          
                                                                </p>
                                                                
                                                                <?php
    }
    else{
        ?>
             <p class="success">
                                                                  <?php  echo Yii::t('lang', 'payment_success');?>    
                                          
                                                                </p>                                               
            <?php
    }
    ?>
                              
                                                        </div>
                                                    </div><!-- /.modal-content -->
                                                </div><!-- /.modal-dialog -->
                                            </div>
                                            <script>
                                                $('#ModalAlert').modal('show');
                                            </script>
                                            <?php
                                            unset(Yii::app()->session['order_process']);
                                        }
                                        ?>
                                        <?php
                                        $style = '';
                                        $class = 'class="modal"';
                                        $area = 'aria-hidden="true"';
                                        $item = '';
                                        if (isset($_GET['item_id'])) {

                                            $style = 'style="display:block"';
                                            $class = 'class="modal in"';
                                            $area = 'aria-hidden="false"';
                                        }
                                        ?>
                                        <div <?php echo $style . ' ' . $class . ' ' . $area ?>  id="modal-details" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" >
                                            <div class="modal-dialog">
                                                <div class="modal-content ">
                                                    <div class="modal-header">
                                                        <button type="button" class="close" data-dismiss="modal" aria-hidden="true"><img src="<?php echo Yii::app()->theme->baseUrl; ?>/frontend/images/icon_close.png" /></button>
                                                    </div>
                                                    <div class="modal-body">
<?php
if (isset($_GET['event'])) {

    $this->renderItem($_GET['event']);
}
?>
                                                    </div>
                                                </div>
                                            </div><!-- /.modal-content -->
                                        </div><!-- /.modal-dialog -->
                                    </div>
                                    <?php
                                    if (isset($_GET['event'])) {
                                        ?>
                                        <script>
                                            $('#modal-details').modal('show');
                                        </script>
                                            <?php
                                        }
                                        ?>
<?php $this->widget('HeaderWidget'); ?>
                                    <section id="body" class="container">

<?php echo $content; ?>
                                    </section>
<?php $this->widget('FooterWidget'); ?>
                                    <!-- page -->

                                </body>
                                </html>
